package com.hashmap1;

import java.util.HashMap;
import java.util.Map;

public class Test1 {
public static void main(String[] args) {
	Map<String, String> map=new HashMap<String, String>();
	map.put("1", "one");
	map.put("2", "two");
	map.put("3", "three");
	map.put("4", "four");
	Object ob=getKeyFromValue(map, "two");
	System.out.println(ob);
}
public static Object getKeyFromValue(Map hm,Object value){
	for(Object obj:hm.keySet()){
		if(hm.get(obj).equals(value))
			return obj;
	}
	return null;
}
}
